package com.libgdxbar.pvzlikegame.objects;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Vector2;
import com.libgdxbar.pvzlikegame.AssetsLoader;
import com.libgdxbar.pvzlikegame.entities.LocationEntity;
import org.libgdxbar.projects.interfaces.animation.IAnimator;
import org.libgdxbar.projects.interfaces.animation.BaseTrackEntry;
import org.libgdxbar.projects.interfaces.renderer.IBatchRender;
import org.libgdxbar.projects.interfaces.renderer.ITextureRegion;

public class SampleAnimationPlant extends LocationEntity implements IAnimator, ITextureRegion, IBatchRender {

	private TextureRegion region = new TextureRegion();
	private final Texture texture = AssetsLoader.getInstance().get("plant-stub.png", Texture.class);

	public SampleAnimationPlant(float x, float y) {
		super(x, y);
	}

	@Override
	public void run(float delta) {
		super.run(delta);
	}

	@Override
	public void render(Batch batch) {
		Vector2 position = getPosition();
		batch.draw(region, position.x, position.y, 50, 50);
	}

	@Override
	public BaseTrackEntry changeAnimation(String animationName) {
		return null;
	}

	@Override
	public TextureRegion getTextureRegion() {
		return region;
	}

	@Override
	public void setTextureRegion(TextureRegion region) {
		region.setRegion(region);
	}
}
